feat(compiler): catching unhandled exceptions#77
Conversation
fe16f7c to
5c71d68
Compare
- Adding exception handling in the compiler console app to catch any unhandled exceptions. - Adding an issue template for bug tracking and linking it in the console output if an unhandled exception occurs. Part of #60
5c71d68 to
09406dc
Compare
adamconnelly
left a comment
There was a problem hiding this comment.
Looks great - cheers for doing that Ross. I've just added a few really minor suggestions.
| @@ -0,0 +1,29 @@ | |||
| # Bug: -Title- | |||
There was a problem hiding this comment.
I think you can automatically set a few properties like labels by adding some yaml frontmatter to the file. Something like this:
---
name: Bug
about: Use this template for reporting bugs in Thrift.Net.
labels: "type/bug"
---There's some details about it here: https://docs.github.com/en/free-pro-team@latest/github/building-a-strong-community/manually-creating-a-single-issue-template-for-your-repository
Should we maybe call the file bug_template.md as well?
Can I get you to move this to a .github directory as well, just so we put anything related to automating GitHub in the one place?
| console.Error.Write($"The specified input file '{input.Name}' could not be found.{Environment.NewLine}"); | ||
| return (int)ExitCode.InputFileNotFound; | ||
| } | ||
| if (!input.Exists) |
There was a problem hiding this comment.
Maybe worth extracting this code out to a method, just to keep the Main() method fairly simple?
| console.Out.Write($"Error: {exception}{Environment.NewLine}{Environment.NewLine}"); | ||
| console.Out.Write($"Thrift.Net has encountered an error. This is a problem with the compiler and not caused by your code.{Environment.NewLine}"); | ||
| console.Out.Write($"Please help us to resolve this by reporting a new issue here: https://github.com/adamconnelly/Thrift.Net/issues/new?template=issue_template.md. {Environment.NewLine} {Environment.NewLine}"); | ||
| console.Out.Write($"We welcome contributions, so please feel free to create a PR to resolve the issue.{Environment.NewLine}"); |
There was a problem hiding this comment.
| console.Out.Write($"We welcome contributions, so please feel free to create a PR to resolve the issue.{Environment.NewLine}"); | |
| console.Out.Write($"We welcome contributions, so feel free to create a PR to resolve the issue.{Environment.NewLine}"); |
After reading it I just figure we had too many "pleases" in there 😸
| { | ||
| console.Out.Write($"Error: {exception}{Environment.NewLine}{Environment.NewLine}"); | ||
| console.Out.Write($"Thrift.Net has encountered an error. This is a problem with the compiler and not caused by your code.{Environment.NewLine}"); | ||
| console.Out.Write($"Please help us to resolve this by reporting a new issue here: https://github.com/adamconnelly/Thrift.Net/issues/new?template=issue_template.md. {Environment.NewLine} {Environment.NewLine}"); |
There was a problem hiding this comment.
Maybe we could set the component/compiler label via a query string parameter here? Like you say, once the template's in place it'll be easier to try that out.
|
@RossAndersonDev you up for finishing this up and getting it merged? Your changes look great, so it'd be awesome to get it in! |
Adding exception handling in the console app to catch any unhandled
exceptions.
Adding an issue template for bug tracking and linking it in the
console output if an unhandled exception occurs.
Part of #60
Screenshot of exception output
